{extend name='extra@admin/content'}

{block name="button"}
<div class="nowrap pull-right" style="margin-top:10px">
    {if condition="$store_id != 0"}
        <a href='{:url("kuguan/storesale/export")}?date={$Think.get.date}&store_id={$Think.get.store_id}' class="layui-btn layui-btn-small" style="text-decoration:none"><i class="fa fa-mail-forward"></i>
            导出
        </a>
    {else /}
        <a href="javascript:;" onclick="no_export();" class="layui-btn layui-btn-small " style="text-decoration:none;"><i class='fa fa fa-mail-forward'></i> 导出</a>
    {/if}
</div>
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form class="animated form-search" action="__SELF__" onsubmit="return false" method="get">
    <div class="col-xs-2">
        <div class="form-group">
            <select name="store_id"  lay-filter="export" class="input-sm form-control">
                <option value="">- 选择门店 -</option>
                {foreach store as $v1}
                <option value="{$v1.id}" {if $Think.get.store_id eq $v1.id} selected {/if}>{$v1.title}</option>
                {/foreach}
            </select>
        </div>
    </div>

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">下单时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}"
                   placeholder="请选择时间" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>
</form>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    {if $store_id == ''}
        <p class="help-block text-center well">请 先 选 择 门 店！</p>
    {else /}
        <table class="layui-table" lay-skin="line" lay-size="sm">
            <thead>
                <tr>
                    <th class='text-left nowrap'>付款方式</th>
                    <th class='text-left nowrap'>金额</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td class='text-left nowrap'>
                        支付宝
                    </td>
                    <td class='text-left nowrap'>
                        {$ali_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        微信
                    </td>
                    <td class='text-left nowrap'>
                        {$wx_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        会员卡
                    </td>
                    <td class='text-left nowrap'>
                        {$yue_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        现金
                    </td>
                    <td class='text-left nowrap'>
                        {$cash_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        银行卡
                    </td>
                    <td class='text-left nowrap'>
                        {$bank_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        美团
                    </td>
                    <td class='text-left nowrap'>
                        {$meituan_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        饿了吗
                    </td>
                    <td class='text-left nowrap'>
                        {$elema_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        优惠券
                    </td>
                    <td class='text-left nowrap'>
                        {$coupon_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        代金券
                    </td>
                    <td class='text-left nowrap'>
                        {$cash_coupon_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        退款
                    </td>
                    <td class='text-left nowrap'>
                        {$back_amount}
                    </td>
                </tr>
                <tr>
                    <td class='text-left nowrap'>
                        总计
                    </td>
                    <td class='text-left nowrap'>
                        {$final_amount}
                    </td>
                </tr>
            </tbody>
        {/if}
    </table>
    <script>
        window.laydate.render({range: true, elem: '#range-date', format: 'yyyy/MM/dd'});

        /**
         * 不能导信息
         */
        function no_export(){
            layer.msg('请先选择门店',{icon: 2, time: 1500});
            return false;
        }
    </script>
</form>
{/block}